package com.sanhuo.security.global;

public enum  ResponseEnum {
    SUCCESS(200,"成功"),

    FAIL(404,"获取资源失败"),

    EXCEPTION(500,"系统异常"),

    LOGIN_SUCCESS(201,"登陆成功"),

    LOGIN_FAILE(501,"身份验证失败,请重新登录!"),

    INDEX_VERIFY_FAILE(502,"未通过登录验证,请登录");

    private Integer code;

    private String msg;
    public static  boolean isWrong(Integer code){
        return code == FAIL.getCode() || code == EXCEPTION.getCode() || code == LOGIN_FAILE.getCode();
    }
    private ResponseEnum (Integer code,String msg){

        this.code=code;

        this.msg=msg;

    }
    public Integer getCode() {

        return code;

    }

    public void setCode(Integer code) {

        this.code = code;

    }

    public String getMsg() {

        return msg;

    }
}
